<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{msg}}</h1>
        <button @click="msg = 'yes your are right!!'">changefoo</button>
        <!-- 如何调用更新函数？？ 这个调用不起！！ <button @click="$update()">update</button> -->
        <button @click="$destroy()">destroy</button>
    </div>
    
    <script src="vue.js"></script>
    <script>
        new Vue({
            el:"#app",
            data(){
                return {
                    msg:"hello,sam!,you can do it,you are best!!!"
                }
            },
            beforeCreate(){
                console.log("beforeCreate");
            },
            created(){
                console.log("created");
            },
            beforeMount(){
                console.log("beforeMount");
            },
            mounted(){
                console.log("<h1>'mounted'</h1>");
            },
            beforeUpdate(){
                console.log("beforeUpdate");
            },
            updated(){
                console.log("updated");
            },
            beforeDestroy(){
                console.log("beforeDestroy");
            },
            destroyed(){
                console.log("destoryed");
            },
        })
    
    </script>
    
</body>
</html>